#ifndef LINE_H
#define LINE_H

#include <QGraphicsLineItem>
#include <QGraphicsScene>
#include <QPen>
#include <math.h>
#include "item.h"

class Item;

class Line : public QGraphicsLineItem
{
public:
    Line();
    //iType equal 1 if line and 0 if stream
    Line(Item * From, Item * To, int iType);
    ~Line();

    Item *From() const;
    Item *To() const;

    void MergeItems();
    Item * GetItem() const;
    void SetFromId(int id);
    void SetToId(int id);
    void SetTextId(int id);
    void SetText(Item * text);
    int GetFromId() const;
    int GetToId() const;
    int GetTextId() const;
    int GetType() const;
    bool d;


private:
    Item *MyFrom;
    Item *MyTo;
    int iFromId;
    int iToId;
    QPen pen;
    int iType;
    Item * Text;
    int iTextId;
};

#endif // LINE_H
